import QtQuick 1.1
import com.nokia.meego 1.0

Item {
  id: rotator

  property bool show: false
  property int delay: 2000

  width: parent.width
  height: parent.height
  opacity: 0

  Behavior on opacity { PropertyAnimation { duration: 250 } }

  Fader {
    fadingOpacity: 0.4
    state: rotator.opacity == 1 ? "faded" : ""
    transitionDuration: 250
    anchors.fill: parent
    color: "#f5f5f5"
  }

  BusyIndicator {
    id: indicator
    platformStyle: BusyIndicatorStyle { size: "large" }
    running:  rotator.show
    anchors.centerIn: parent
  }

  Timer {
    interval: rotator.delay
    running: rotator.show
    repeat: false
    onTriggered: opacity = 1
  }

  onShowChanged: {
    if (show == false) opacity = 0
  }
}
